<?php
/**
 * Default controller
 *
 * PHP version 5
 *
 * @category   Web
 * @package    Data2People
 * @subpackage Controllers
 * @author     Mike Bevz <mike.bevz@data2people>
 * @copyright  2007-2008 (c) Mike Bevz
 * @license    The BSD License http://data2people.com/license.txt
 * @version    SVN: $Id: IndexController.php 17 2008-12-02 00:46:38Z michael.bevz $
 *
 *
 */

/**
 * Includes
 */
require_once 'Zend/Controller/Action.php';

/**
 * Default controller
 *
 * PHP version 5
 *
 * @category   Web
 * @package    Data2People
 * @subpackage Controllers
 * @author     Mike Bevz <mike.bevz@data2people>
 * @copyright  2007-2008 (c) Mike Bevz
 * @license    The BSD License http://data2people.com/license.txt
 * @version    SVN: $Id: IndexController.php 17 2008-12-02 00:46:38Z michael.bevz $
 *
 *
 */

class IndexController extends Zend_Controller_Action
{
    
    /**
     * Index action
     *
     * @return void
     */
    public function indexAction()
    {
        $query = Doctrine_Query::create();
        /*$query->select('r.*, COUNT(r.news_id) count')
              ->from("TagRefNews r")
              ->orderBy('count DESC')
              ->groupBy('r.tag_id')
              ->limit(50);*/
        
        $query->select('c.content, c.frequency, c.occur, c.tag_id')
              ->from("Cloud c")
              ->orderBy('c.pubdate DESC, c.content ASC')
              ->limit(400);
              
        $cloud = $query->execute();
        $this->view->assign('cloud', $cloud);
    }
}